package com.data.basic.chapter06;

import java.util.ArrayList;
import java.util.Random;

/**
 * Created by wangbing on 2018/5/6.
 */
public class BSTMain {
    public static void main(String[] args) {
        BST01<Integer> bst = new BST01<Integer>();
//        int nums[] = {5,3,6,8,4,2};
//        for(int num : nums){
//            bst.add(num);
//        }


        Random random = new Random();
        int n = 10;
        for (int i=0;i<n;i++){
            bst.add(random.nextInt(10));
        }
        System.out.println(bst);
        ArrayList<Integer> list = new ArrayList();
        while (!bst.isEmpty()){
            list.add(bst.removeMax());
        }
        System.out.println(list);


    }
}
